<%@ page language="java"  pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>

<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title><s:property value="scrName"/>-沈阳外卖网</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="在<s:property value="scrName"/>附近叫外卖，查看<s:property value="scrName"/>附近的餐厅、美食信息" />
<!-- Bootstrap -->
<link href="publicui/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
<!--[if lt IE 9]>
  <script src="public/js/html5shiv.js"></script>
<![endif]-->
<!-- application  -->
<link href="css/head.css" rel="stylesheet" />
<link href="css/foot.css" rel="stylesheet" />
<link href="css/last.css" rel="stylesheet" />
<script type="text/javascript">
var typeId=new Array(""
        <s:if test="typeList!=null">
  		<s:iterator id="tl" value="%{typeList}">
                ,"<s:property value="#tl.id"/>"
        </s:iterator>
  		</s:if>
);
function showAll(){
	for(var i=1;i<typeId.length;i++){
		document.getElementById('food-category-'+typeId[i]).style.display="";
    }
}
function showType(id){
	for(var i=1;i<typeId.length;i++){
		if(typeId[i] == id){
			document.getElementById('food-category-'+typeId[i]).style.display="";
		}
		else{
			document.getElementById('food-category-'+typeId[i]).style.display="none";
		}
    }
}
</script>
</head>

<body >
<div class="bodybg" >
<!-----nav-->
<s:action name="top" executeResult="true"></s:action>
<!---/nav   --> 

<!---/body   -->
<div class="content" > 
  <!--  -->
  <ul class="content-nav" >
    <li> <a href="resList.action?id=<s:property value="scrId"/>"><s:property value="scrName"/></a>&nbsp; <a href="index.action">[切换地址]</a> </li>
     <li><a href=""><s:property value="restaurant.resName"/></a></li>
  </ul>
  <!--  content    start   -->
  <div class="row-fluid">
      <div class="span12 right-fold bordered-box">
        <div class="important-info alert warning"> <s:property value="restaurant.notice"/> </div>
        <div class="row-fluid">
          <div class="span9 master-side restaurant-content">
            <ul class="nav nav-tabs restaurant-tab">
              <li class="active"><a rel="nofollow" href="#">菜单</a></li>
             <!-- <li ><a rel="nofollow" href="#">评价</a></li>  -->
            </ul>
            <div class="restaurant-tab-content">
              <div class="menu-category-filter">
                <ul>
                  <li rel="all" class="active" onclick="showAll();">所有美食</li>
                  <s:if test="typeList!=null">
                  <s:iterator id="tl" value="%{typeList}">
                  	<li rel="<s:property value="#tl.id"/>" onclick="showType(<s:property value="#tl.id"/>);"><s:property value="#tl.typeName"/></li>
                  </s:iterator>
                  </s:if>
                </ul>
              
              </div>
              <div class="menu">
                <div class="sorter-wrapper">
                    <a rel="nofollow" class="sorter  price---" href="#" rel="nofollow" > 
                    <span class="bg" > 
                        <span class="text">价格</span> 
                        <span class="asc"></span>
                    </span> 
                    <span class="pad"></span> 
                    </a>
                    <a rel="nofollow" class="sorter  pop--" href="#" rel="nofollow" > 
                    <span	class="bg"> 
                        <span class="text">人气</span> 
                        <span class="desc"></span>
                    </span> 
                    <span class="pad"></span> 
                    </a>
                    <a rel="nofollow" class="sorter  rating" href="#" rel="nofollow" >
                        <span class="bg"> 
                            <span class="text">评价</span> 
                            <span class="desc"></span> 
                        </span> 
                        <span class="pad"></span> 
                    </a>
                </div>
           		<!--  单个菜单分类  start     -->
           		<s:if test="typeList!=null">
                <s:iterator id="tl" value="%{typeList}">
                <div class="food-category" id="food-category-<s:property value="#tl.id"/>"> <a name="category-<s:property value="#tl.id"/>"></a>
                  <ul class="food-list ">
                    <h3 class="food-category-title"><s:property value="#tl.typeName"/></h3>
                    <!--  单条菜价   start  -->
                    <s:if test="#tl.resMenuList!=null">
                    <s:iterator id="rml" value="%{#tl.resMenuList}">
                    <li class="food-item" id="food-1649666">
                      <div class="line-one"> 
                        <div class="green_right"></div>
                        <div class="name">
                          <h4><s:property value="#rml.menuName"/></h4>
                        </div>
                        <div class="price"><s:property value="#rml.price"/>元</div>
                        <div class="action"> <span class="food-action-wrapper with-add-to"> <a rel="nofollow" href="/az-xxgy?fid=<s:property value="#rml.id"/>" class="food-action add" entity_id="<s:property value="#rml.id"/>"></a> <a href="#" class="food-action add-to" entity_id="<s:property value="#rml.id"/>"></a> </span> </div>
                        <div class="month-sold">dddd</div>
                        <div class="rating"> <span class="rating-star r<s:property value="#rml.score"/>"></span> </div>
                      </div>
                      <div class="line-two"> <a class="desc" rel="tooltip" title=""></a> <a href="/food/277452849427282" target="_blank" class="extra-action-wrapper hover-food-link" rel="1649666"><s:property value="#rml.scorePeople"/>点评</a> </div>
                    </li>
                    </s:iterator>
                    </s:if>
                    <!--  单条菜价   end  -->
                  </ul>
                </div>
                </s:iterator>
                </s:if>
                <!--  单个菜单分类  start     -->
              </div>
            </div>
          </div>
          <div class="span3 slave-side">
            <div class="restaurant-panel-wrapper restaurant-panel"> <span class="favor-icon"></span>
              <div class="restaurant-block">
                <div class="line-one">
                  <div class="logo-wrapper">
                    <div class="logo"> <img class="restaurant-logo" alt="" src="http://fuss10.elemecdn.com/a/b8/24ff7fcd943b22571516631cf1407jpeg.jpeg"> </div>
                    <div class="deliver-time-wrapper">  分钟 </div>
                  </div>
                  <div class="info">
                    <div class="name" title="<s:property value="restaurant.resName"/>"><s:property value="restaurant.resName"/></div>
                    <div class="flavors three-line"> <s:property value="restaurant.resTaste"/> </div>
                    <div class="ratings three-line">
                      <div class="r<s:property value="restaurant.score"/> rating-star" title="餐厅评价：<s:property value="restaurant.score"/>分"> <span class="ratings"></span> </div>
                      <!-- span class="rating-number">62点评 (30天内)</span> </div -->
                  </div>
                </div>
              </div>
              <div class="restaurant-more-info">
                <div class="divider "></div>
                <p class="ann"><strong>公告:</strong>&nbsp;<s:property value="restaurant.notice"/></p>
                <p class="ann"><strong>促销:</strong>&nbsp;<s:property value="restaurant.salesPromotion"/></p>
                <p class="ann"><strong>特殊说明:</strong>&nbsp;<s:property value="restaurant.specialMemo"/></p>
                <p class="restaurant-deliver-desc"><strong>起送价:</strong>&nbsp;<s:property value="restaurant.deliveryPrice"/>元</p>
                <p><strong>地址:</strong>&nbsp;<s:property value="restaurant.address"/></p>
                <p><strong>营业时间:</strong>&nbsp;09:30 - 21:00</p>
                <p><strong>简介:</strong>&nbsp;<s:property value="restaurant.summary"/></p>
                <s:if test="uid>0">
                <p id="collect_p" class="btn-wrapper">
                	<s:if test="restaurant.isCollect==1"><button class="btn small yellow  favor-restaurant" onclick="collect(0,<s:property value="restaurant.id"/>);"><span>取消收藏</span></button></s:if>
                	<s:if test="restaurant.isCollect==0"><button class="btn small yellow  favor-restaurant" onclick="collect(1,<s:property value="restaurant.id"/>);"><span>添加收藏</span></button></s:if>
                </p>
                </s:if>
              </div>
            </div>
          </div>
        </div>
      </div>
    
    </div>
  

<!--   content    end    -->
  <s:action name="foot" executeResult="true"></s:action>
<!---/body   --> 

</div>
<!--  buy  box  -->
<div class="bottom-cart" id="bottom-cart" style="bottom: 0px; ">
  <div class="bottom-content">
    <div class="line-detail hidden" style="display: none; ">
      <table class="cart-detail-table table table-bordered table-striped hidden" id="cart-detail-table-0" style="display: table; ">
        <thead>
          <tr>
            <th class="name">美食名称<br></th>
            <th class="price">单价<br></th>
            <th class="quantity">数量<br></th>
            <th class="subtotal">总价<br></th>
            <th class="action"> <a class="cart-action cart-clear-group" href="/cart/clearGroup/group_id/0">清空</a> <span class="cart-close"></span> <br></th>
          </tr>
        </thead>
        <tbody>
          <tr class="food-line" rel="1900739">
            <td class="name"><span>干锅小黄鱼</span><br></td>
            <td class="price">￥28<br></td>
            <td class="quantity">
              <input class="order-item" type="text" autocomplete="off" value="1" parent_entity_id="0" group_id="0">
              <br></td>
            <td class="subtotal">￥28<br></td>
            <td class="action"><a href="/cart/delete/group_id/0/entity_id/1900739/parent_entity_id/0" class="cart-action cart-delete"> </a><br></td>
          </tr>
          <tr class="food-line" rel="1900738">
            <td class="name"><span>干锅娃娃菜</span><br></td>
            <td class="price">￥28<br></td>
            <td class="quantity">
              <input class="order-item" type="text" autocomplete="off" value="1" parent_entity_id="0" group_id="0">
              <br></td>
            <td class="subtotal">￥28<br></td>
            <td class="action"><a href="/cart/delete/group_id/0/entity_id/1900738/parent_entity_id/0" class="cart-action cart-delete"> </a><br></td>
          </tr>
          <tr class="food-line" rel="1900737">
            <td class="name"><span>干锅白萝卜</span><br></td>
            <td class="price">￥22<br></td>
            <td class="quantity">
              <input class="order-item" type="text" autocomplete="off" value="1" parent_entity_id="0" group_id="0">
              <br></td>
            <td class="subtotal">￥22<br></td>
            <td class="action"><br><br><a href="/cart/delete/group_id/0/entity_id/1900737/parent_entity_id/0" class="cart-action cart-delete"></a><br></td>
          </tr>
        </tbody>
      </table>
    
    </div>
    <div class="line-brief">
      <div class="col-restaurant-name"> @健将一品 </div>
      <div class="col-group closed" id="col-group-0" rel="0" style="display: block; "> 1号篮子 </div>
      <div class="col-add-group hidden" style="display: block; "> 增加篮子 </div>
      <div class="col-desc " id="col-desc-0" style="display: none; "> 干锅白萝卜 1份 / 干锅娃娃菜 1份 / 干锅小黄鱼 1份 </div>
      <div class="col-button">
        <button class="btn btn-yellow cart-btn"><span class="cart-checkout">买单</span></button>
      </div>
      <div class="col-total"> 共 1 个篮子 | 3 份美食 | 合计 78 元 </div>
    </div>
    <div id="cart-add-effect" style="left: 665.5px; bottom: 200px; display: none; opacity: 1; "><img src="http://static10.elemecdn.com/images/forward/cart/cart_arrow_down.png" alt="down_arrow"></div>
      <!--
   <div class="line-brief">
      <div class="col-group active" id="col-group-0" style="display: block; "> 1号篮子(空) </div>
      <div class="col-desc" > 请选择你喜欢的美食 </div>
      <div class="col-button">
            <button class="btn btn-yellow cart-btn"><span class="cart-checkout">买单</span></button>
      </div>
      <div class="col-total"> 共 0 个篮子 | 0 份美食 | 合计 0 元 </div>
    </div>
    
    <div id="cart-add-effect">
        <img src="http://static10.elemecdn.com/images/forward/cart/cart_arrow_down.png" alt="down_arrow">
    </div>
    -->
  </div>
</div>
<!--  /buy  box  -->


<script src="publicui/js/jquery-1.8.3.js"></script> 
<script src="publicui/jquery-ui/js/jquery-ui-1.9.2.custom.js"></script> 
<script src="publicui/bootstrap/js/bootstrap.min.js"></script> 
<script src="js/head.js"></script> 
<script type="text/javascript">
function collect(s,id){
	if(s==0){
		$.ajax({
			url:"collect.action?action=removeAjax&objId="+id+"&objType=0",
			dataType:"html", 
			success: function(html){
				if(html==0){
					$('#collect_p').html('<button class="btn small yellow  favor-restaurant" onclick="collect(1,'+id+');"><span>添加收藏</span></button>');
				}
			}
		});
	}else{
		$.ajax({
			url:"collect.action?action=saveRes&objType=0&objId="+id,
			dataType:"html", 
			success: function(html){
				if(html==0){
					$('#collect_p').html('<button class="btn small yellow  favor-restaurant" onclick="collect(0,'+id+');"><span>取消收藏</span></button>');
				}else if(html==1){
					alert("您已经收藏了此店铺");
				}else{
					alert("操作失败，请稍后尝试");
				}
			}
		});
	}
}
</script>
</body> 
</html>